//
//  ViewController.m
//  demo_oc
//
//  Created by wzz on 2024/6/12.
//

#import "ViewController.h"
#import "sdk_bi_client.h"



static int roleLevel = 1;
static int roleVipLevel = 1;

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Do any additional setup after loading the view.
    
    
    CGFloat screenWidth =  self.view.bounds.size.width;
    CGFloat screenHeight = self.view.bounds.size.height;
    
    
    
    NSButton *initBtn = [NSButton buttonWithTitle:@"初始化sdk" target:self action:@selector(initBtnDidClick)];
    [initBtn setFrame:CGRectMake(0, screenHeight - 40, 120, 40)];
    [self.view addSubview:initBtn];
    
    NSButton *customEvent = [NSButton buttonWithTitle:@"自定义事件" target:self action:@selector(customEventBtnDidClick)];
    [customEvent setFrame:CGRectMake(0, screenHeight - 80, 120, 40)];
    [self.view addSubview:customEvent];
    
    NSButton *sync_customEvent = [NSButton buttonWithTitle:@"sync自定义事件" target:self action:@selector(syncCustomEventDidClick)];
    [sync_customEvent setFrame:CGRectMake(0, screenHeight - 120, 120, 40)];
    [self.view addSubview:sync_customEvent];
    
    NSButton *authTokenBtn = [NSButton buttonWithTitle:@"设置token" target:self action:@selector(authTokenEventDidClick)];
    [authTokenBtn setFrame:CGRectMake(0,screenHeight - 160, 120, 40)];
    [self.view addSubview:authTokenBtn];
    
    NSButton *accountLoginBtn = [NSButton buttonWithTitle:@"账号登录事件" target:self action:@selector(OnAccountLoginBtnDidClick)];
    [accountLoginBtn setFrame:CGRectMake(0, screenHeight - 200, 120, 40)];
    [self.view addSubview:accountLoginBtn];
    
    NSButton *roleLoginBtn = [NSButton buttonWithTitle:@"角色登录事件" target:self action:@selector(OnRoleLoginBtnDidClick)];
    [roleLoginBtn setFrame:CGRectMake(0, screenHeight - 240, 120, 40)];
    [self.view addSubview:roleLoginBtn];
    
    NSButton *accountLogoutBtn = [NSButton buttonWithTitle:@"登出事件" target:self action:@selector(OnAccountLogoutBtnDidClick)];
    [accountLogoutBtn setFrame:CGRectMake(120, screenHeight - 40, 120, 40)];
    [self.view addSubview:accountLogoutBtn];
    
    NSButton *roleLogoutBtnDidClick = [NSButton buttonWithTitle:@"角色登出事件" target:self action:@selector(OnRoleLogoutBtnDidClick)];
    [roleLogoutBtnDidClick setFrame:CGRectMake(120, screenHeight - 80, 120, 40)];
    [self.view addSubview:roleLogoutBtnDidClick];
    
    NSButton *roleLevelUpBtnDidClick = [NSButton buttonWithTitle:@"角色vip升级事件" target:self action:@selector(OnRoleLevelUpBtnDidClick)];
    [roleLevelUpBtnDidClick setFrame:CGRectMake(120, screenHeight - 120, 120, 40)];
    [self.view addSubview:roleLevelUpBtnDidClick];
    
    NSButton *payFinishBtn = [NSButton buttonWithTitle:@"付费事件" target:self action:@selector(OnPayFinishBtnDidClick)];
    [payFinishBtn setFrame:CGRectMake(120, screenHeight - 160, 120, 40)];
    [self.view addSubview:payFinishBtn];
    
    NSButton *payOrderCancelBtn = [NSButton buttonWithTitle:@"付费取消事件" target:self action:@selector(OnBtPayOrderCancelBtnDidClick)];
    [payOrderCancelBtn setFrame:CGRectMake(120, screenHeight - 200, 120, 40)];
    [self.view addSubview:payOrderCancelBtn];
    
    NSButton *paybtFailBtn = [NSButton buttonWithTitle:@"bt付费失败事件" target:self action:@selector(OnBtPayFailBtnDidClick)];
    [paybtFailBtn setFrame:CGRectMake(120, screenHeight - 240, 120, 40)];
    [self.view addSubview:paybtFailBtn];
    
    NSButton *paybtOtherBtn = [NSButton buttonWithTitle:@"bt付费其他事件" target:self action:@selector(OnBtPayOtherBtnDidClick)];
    [paybtOtherBtn setFrame:CGRectMake(240, screenHeight - 40, 120, 40)];
    [self.view addSubview:paybtOtherBtn];
    
    NSButton *paybtProgressBtn = [NSButton buttonWithTitle:@"bt付费进度事件" target:self action:@selector(OnBtPayProgressBtnDidClick)];
    [paybtProgressBtn setFrame:CGRectMake(240, screenHeight - 80, 120, 40)];
    [self.view addSubview:paybtProgressBtn];
    
    NSButton *onBtGameXgPayBtn = [NSButton buttonWithTitle:@"bt游戏西瓜付费事件" target:self action:@selector(OnBtGameXgPayBtnDidClick)];
    [onBtGameXgPayBtn setFrame:CGRectMake(240, screenHeight - 120, 120, 40)];
    [self.view addSubview:onBtGameXgPayBtn];
    
    NSButton *onMissionBeginBtn = [NSButton buttonWithTitle:@"任务开始" target:self action:@selector(OnMissionBeginBtnDidClick)];
    [onMissionBeginBtn setFrame:CGRectMake(240, screenHeight - 160, 120, 40)];
    [self.view addSubview:onMissionBeginBtn];
    
    NSButton *missionFailBtn = [NSButton buttonWithTitle:@"任务错误" target:self action:@selector(OnMissionFailBtnDidClick)];
    [missionFailBtn setFrame:CGRectMake(240, screenHeight - 200, 120, 40)];
    [self.view addSubview:missionFailBtn];
    
    NSButton *missionSuccessBtn = [NSButton buttonWithTitle:@"任务成功" target:self action:@selector(OnMissionSuccessBtnDidClick)];
    [missionSuccessBtn setFrame:CGRectMake(240, screenHeight - 240, 120, 40)];
    [self.view addSubview:missionSuccessBtn];
    
    NSButton *missionEndEventBtn = [NSButton buttonWithTitle:@"任务结束事件" target:self action:@selector(OnMissionEndEventBtnDidClick)];
    [missionEndEventBtn setFrame:CGRectMake(240, screenHeight - 280, 120, 40)];
    [self.view addSubview:missionEndEventBtn];
    
    NSButton *virtualCurrencyGainBtn = [NSButton buttonWithTitle:@"虚拟货币收益" target:self action:@selector(OnVirtualCurrencyGainBtnDidClick)];
    [virtualCurrencyGainBtn setFrame:CGRectMake(360, screenHeight - 40, 120, 40)];
    [self.view addSubview:virtualCurrencyGainBtn];
    
    NSButton *virtualCurrencyGainForPurchasedBtn = [NSButton buttonWithTitle:@"虚拟货币购买" target:self action:@selector(OnVirtualCurrencyGainForPurchasedBtnDidClick)];
    [virtualCurrencyGainForPurchasedBtn setFrame:CGRectMake(360, screenHeight - 80, 120, 40)];
    [self.view addSubview:virtualCurrencyGainForPurchasedBtn];
    
    NSButton *virtualCurrencyConsumeBtn = [NSButton buttonWithTitle:@"虚拟货币消费" target:self action:@selector(OnVirtualCurrencyConsumeBtnDidClick)];
    [virtualCurrencyConsumeBtn setFrame:CGRectMake(360, screenHeight - 120, 120, 40)];
    [self.view addSubview:virtualCurrencyConsumeBtn];
    
    NSButton *itemGainBtnDid = [NSButton buttonWithTitle:@"item收益事件" target:self action:@selector(OnItemGainBtnDidClick)];
    [itemGainBtnDid setFrame:CGRectMake(360, screenHeight - 160, 120, 40)];
    [self.view addSubview:itemGainBtnDid];
    
    NSButton *itemConsumeBtn = [NSButton buttonWithTitle:@"item消费事件" target:self action:@selector(OnItemConsumeBtnDidClick)];
    [itemConsumeBtn setFrame:CGRectMake(360, screenHeight - 200, 120, 40)];
    [self.view addSubview:itemConsumeBtn];
    
    NSButton *gameLoadResourceBtn = [NSButton buttonWithTitle:@"游戏资源加载事件事件" target:self action:@selector(OnGameLoadResourceDidClick)];
    [gameLoadResourceBtn setFrame:CGRectMake(360, screenHeight - 240, 120, 40)];
    [self.view addSubview:gameLoadResourceBtn];
    
    NSButton *gameLoadConfigBtn = [NSButton buttonWithTitle:@"游戏资源配置事件" target:self action:@selector(OnGameLoadConfigBtnDidClick)];
    [gameLoadConfigBtn setFrame:CGRectMake(480, screenHeight - 40, 120, 40)];
    [self.view addSubview:gameLoadConfigBtn];
    
    NSButton *openAnnouncementBtn = [NSButton buttonWithTitle:@"打开公告" target:self action:@selector(OnOpenAnnouncementBtnDidClick)];
    [openAnnouncementBtn setFrame:CGRectMake(480, screenHeight - 40, 120, 40)];
    [self.view addSubview:openAnnouncementBtn];
    
    NSButton *onCloseAnnouncementBtn = [NSButton buttonWithTitle:@"关闭公告" target:self action:@selector(OnCloseAnnouncementBtnDidClick)];
    [onCloseAnnouncementBtn setFrame:CGRectMake(480, screenHeight - 80, 120, 40)];
    [self.view addSubview:onCloseAnnouncementBtn];
    
    NSButton *newUserMissionBtn = [NSButton buttonWithTitle:@"用户新任务按钮" target:self action:@selector(OnNewUserMissionBtnDidClick)];
    [newUserMissionBtn setFrame:CGRectMake(480, screenHeight - 120, 120, 40)];
    [self.view addSubview:newUserMissionBtn];
    
    NSButton *scanResultSuccessBtn = [NSButton buttonWithTitle:@"扫一扫成功结果" target:self action:@selector(OnScanResultSuccessBtnDidClick)];
    [scanResultSuccessBtn setFrame:CGRectMake(480, screenHeight - 160, 120, 40)];
    [self.view addSubview:scanResultSuccessBtn];
    
    NSButton *scanResultFailBtn = [NSButton buttonWithTitle:@"扫一扫失败结果" target:self action:@selector(OnScanResultFailBtnDidClick)];
    [scanResultFailBtn setFrame:CGRectMake(480, screenHeight - 200, 120, 40)];
    [self.view addSubview:scanResultFailBtn];
    
    NSButton *clickDownloadLinkBtn = [NSButton buttonWithTitle:@"点击下载链接" target:self action:@selector(OnClickDownloadLinkBtnDidClick)];
    [clickDownloadLinkBtn setFrame:CGRectMake(480, screenHeight - 240, 120, 40)];
    [self.view addSubview:clickDownloadLinkBtn];
    
    NSButton *registerBtn = [NSButton buttonWithTitle:@"注册按钮点击" target:self action:@selector(OnRegisterBtnDidClick)];
    [registerBtn setFrame:CGRectMake(480, screenHeight - 280, 120, 40)];
    [self.view addSubview:registerBtn];
    
    NSButton *selectProductBtn = [NSButton buttonWithTitle:@"选择产品点击" target:self action:@selector(OnSelectProductBtnDidClick)];
    [selectProductBtn setFrame:CGRectMake(600, screenHeight - 40, 120, 40)];
    [self.view addSubview:selectProductBtn];
    
    NSButton *gameCreateOrderResult = [NSButton buttonWithTitle:@"创建游戏订单" target:self action:@selector(OnGameCreateOrderResultBtnDidClick)];
    [gameCreateOrderResult setFrame:CGRectMake(600, screenHeight - 80, 120, 40)];
    [self.view addSubview:gameCreateOrderResult];
    
    NSButton *privateFunCodeUseBtn = [NSButton buttonWithTitle:@"用户隐私方法Code" target:self action:@selector(OnPrivateFunCodeUseBtnDidClick)];
    [privateFunCodeUseBtn setFrame:CGRectMake(600, screenHeight - 120, 120, 40)];
    [self.view addSubview:privateFunCodeUseBtn];
    
    NSButton *publicFunCodeUseBtn = [NSButton buttonWithTitle:@"PublicFunCode" target:self action:@selector(OnPublicFunCodeUseBtnDidClick)];
    [publicFunCodeUseBtn setFrame:CGRectMake(600, screenHeight - 160, 120, 40)];
    [self.view addSubview:publicFunCodeUseBtn];
    
    NSButton *funCodeUseBtn = [NSButton buttonWithTitle:@"funCodeUseBtn" target:self action:@selector(OnFunCodeUseBtnDidClick)];
    [funCodeUseBtn setFrame:CGRectMake(600, screenHeight - 200, 120, 40)];
    [self.view addSubview:funCodeUseBtn];
    
    NSButton *payCancelBtn = [NSButton buttonWithTitle:@"用户取消支付" target:self action:@selector(OnPayCancelBtnDidClick)];
    [payCancelBtn setFrame:CGRectMake(600, screenHeight - 240, 120, 40)];
    [self.view addSubview:payCancelBtn];
    
    NSButton *payFailBtn = [NSButton buttonWithTitle:@"支付失败按钮" target:self action:@selector(OnPayFailBtnDidClick)];
    [payFailBtn setFrame:CGRectMake(600, screenHeight - 280, 120, 40)];
    [self.view addSubview:payFailBtn];
    
    NSButton *payOtherBtn = [NSButton buttonWithTitle:@"支付其他事件" target:self action:@selector(OnPayOtherBtnDidClick)];
    [payOtherBtn setFrame:CGRectMake(720, screenHeight - 40, 120, 40)];
    [self.view addSubview:payOtherBtn];
    
    NSButton *paySuccessBtn = [NSButton buttonWithTitle:@"支付成功事件" target:self action:@selector(OnPaySuccessBtnDidClick)];
    [paySuccessBtn setFrame:CGRectMake(720, screenHeight - 80, 120, 40)];
    [self.view addSubview:paySuccessBtn];
    
    NSButton *scanStartBtn = [NSButton buttonWithTitle:@"开始扫一扫" target:self action:@selector(OnScanStartBtnDidClick)];
    [scanStartBtn setFrame:CGRectMake(720, screenHeight - 120, 120, 40)];
    [self.view addSubview:scanStartBtn];
    
    NSButton *accountRegisterBtn = [NSButton buttonWithTitle:@"用户注册按钮" target:self action:@selector(OnAccountRegisterBtnDidClick)];
    [accountRegisterBtn setFrame:CGRectMake(720, screenHeight - 160, 120, 40)];
    [self.view addSubview:accountRegisterBtn];
    
    NSButton *loginBtn = [NSButton buttonWithTitle:@"西瓜开始登录" target:self action:@selector(OnLoginBtnDidClick)];
    [loginBtn setFrame:CGRectMake(720, screenHeight - 200, 120, 40)];
    [self.view addSubview:loginBtn];
    
    NSButton *payBtn = [NSButton buttonWithTitle:@"西瓜开始付费界" target:self action:@selector(OnPayBtnDidClick)];
    [payBtn setFrame:CGRectMake(720, screenHeight - 240, 120, 40)];
    [self.view addSubview:payBtn];
    
    NSButton *xgStartBtn= [NSButton buttonWithTitle:@"西瓜初始化" target:self action:@selector(OnXgStartBtnClick)];
    [xgStartBtn setFrame:CGRectMake(720, screenHeight - 280, 120, 40)];
    [self.view addSubview:xgStartBtn];
    
    NSButton *pushMessageBtn = [NSButton buttonWithTitle:@"推送消息" target:self action:@selector(OnPushMessageBtnDidClick)];
    [pushMessageBtn setFrame:CGRectMake(840, screenHeight - 40, 120, 40)];
    [self.view addSubview:pushMessageBtn];
    
    NSButton *initFailBtn = [NSButton buttonWithTitle:@"初始化失败调用" target:self action:@selector(OnInitFailBtnDidClick)];
    [initFailBtn setFrame:CGRectMake(840, screenHeight - 80, 120, 40)];
    [self.view addSubview:initFailBtn];
    
    NSButton *initSuccessBtn = [NSButton buttonWithTitle:@"初始化成功调用" target:self action:@selector(OnInitSuccessBtnDidClick)];
    [initSuccessBtn setFrame:CGRectMake(840, screenHeight - 120, 120, 40)];
    [self.view addSubview:initSuccessBtn];
    
    NSButton *loginFailBtn = [NSButton buttonWithTitle:@"登录失败" target:self action:@selector(OnLoginFailBtnDidClick)];
    [loginFailBtn setFrame:CGRectMake(840, screenHeight - 160, 120, 40)];
    [self.view addSubview:loginFailBtn];
    
    NSButton *loginCancel = [NSButton buttonWithTitle:@"登录取消" target:self action:@selector(OnLoginCancelDidClick)];
    [loginCancel setFrame:CGRectMake(840, screenHeight - 200, 120, 40)];
    [self.view addSubview:loginCancel];
    
    NSButton *getDeviceId = [NSButton buttonWithTitle:@"获取设备id" target:self action:@selector(getDeviceIdDidClick)];
    [getDeviceId setFrame:CGRectMake(840, screenHeight - 240, 120, 40)];
    [self.view addSubview:getDeviceId];

    
}



- (void)initBtnDidClick {
    
    NSLog(@"初始化sdk");
    XGInitConfig *config = [XGInitConfig new];
    
    int result = [SdkBiClient startStatistic:config];
    NSLog(@"result: %d",result);
}


- (void)customEventBtnDidClick {
    
    NSLog(@"自定义事件");
    [SdkBiClient OnEvent:@"demo_event" eventDesc:@"自定义事件" ext:@{@"ext_key":@"ext_value"}];
}

- (void)syncCustomEventDidClick {
    
    NSLog(@"sync自定义事件");
    [SdkBiClient OnEventSync:@"demo_sync_event" eventDesc:@"sync自定义事件" ext:@{@"ext_sync_key":@"ext__sync_value"}];
}

- (void)authTokenEventDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient SetAuthToken:@"123_authToken"];
}


- (void)OnAccountLoginBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnAccountLogin:@"123_userAccount"];
}

- (void)OnRoleLoginBtnDidClick {
    
    NSLog(@"%s",__func__);
    
    RoleInfo *roleInfo = [RoleInfo new];
    roleInfo.roleLevel = roleLevel;
    roleInfo.roleVipLevel = roleVipLevel;
    roleInfo.accountId = @"accountId";
    roleInfo.roleId = @"roleId";
    roleInfo.server = @"server";
    roleInfo.zoneId = @"zoneId";
    roleInfo.roleName = @"roleName";
    roleInfo.serverName = @"serverName";
    roleInfo.zoneName = @"zoneName";
    roleInfo.partyName = @"partyName";
    roleInfo.gender = @"f";
    roleInfo.ext = @{@"roleInfo_ext_key":@"roleInfo_ext_value"};
    [SdkBiClient OnRoleLogin:roleInfo];
}

- (void)OnAccountLogoutBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnAccountLogout];
}


- (void)OnRoleLogoutBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnRoleLogout];
}


- (void)OnRoleLevelUpBtnDidClick {
    
    NSLog(@"%s",__func__);
    roleLevel++;
    [SdkBiClient OnRoleLevelUp:roleLevel];
}



- (void)OnPayFinishBtnDidClick {
    
    NSLog(@"%s",__func__);
    roleLevel++;
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    [SdkBiClient OnPayFinish:payInfo];
}

- (void)OnBtPayOrderCancelBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    [SdkBiClient OnBtPayOrderCancel:payInfo];
}


- (void)OnBtPayFailBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    [SdkBiClient OnBtPayFail:payInfo];
}


- (void)OnBtPayOtherBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    [SdkBiClient OnBtPayOther:payInfo];
}


- (void)OnBtPayProgressBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    [SdkBiClient OnBtPayProgress:payInfo];
}

- (void)OnBtGameXgPayBtnDidClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnBtGameXgPay:@"OnBtGameXgPay"];
}


- (void)OnMissionBeginBtnDidClick {
    
    NSLog(@"%s",__func__);
    MissionInfo *info = [[MissionInfo alloc] init];
    info.roleCurrentPower = 1;
    info.missionId = @"missionId";
    info.missionName = @"missionName";
    info.ext = @{@"info_ext_key":@"info_ext_value"};
    [SdkBiClient OnMissionBegin:info];
}

- (void)OnMissionFailBtnDidClick {
    
    NSLog(@"%s",__func__);
    MissionInfo *info = [[MissionInfo alloc] init];
    info.roleCurrentPower = 1;
    info.missionId = @"missionId";
    info.missionName = @"missionName";
    info.ext = @{@"info_ext_key":@"info_ext_value"};
    [SdkBiClient OnMissionFail:info];
}

- (void)OnMissionSuccessBtnDidClick {
    
    NSLog(@"%s",__func__);
    MissionInfo *info = [[MissionInfo alloc] init];
    info.roleCurrentPower = 1;
    info.missionId = @"missionId";
    info.missionName = @"missionName";
    info.ext = @{@"info_ext_key":@"info_ext_value"};
    [SdkBiClient OnMissionSuccess:info];
}

- (void)OnMissionEndEventBtnDidClick {
    
    NSLog(@"%s",__func__);
    MissionInfo *info = [[MissionInfo alloc] init];
    info.roleCurrentPower = 1;
    info.missionId = @"missionId";
    info.missionName = @"missionName";
    info.ext = @{@"info_ext_key":@"info_ext_value"};
    [SdkBiClient OnMissionEndEvent:@"issionEndEvent" missionInfo:info];
}


- (void)OnVirtualCurrencyGainBtnDidClick {
    
    NSLog(@"%s",__func__);
    VirtualCurrencyGainInfo *info = [VirtualCurrencyGainInfo new];
    info.gainChannel = @"gainChannel";
    info.gainChannelType = @"gainChannelType";
    info.ext = @{@"info_ext_key":@"info_ext_value"};
    info.amount = 1;
    info.virtualCurrencyTotal = 1;
    info.virtualCurrencyType = @"virtualCurrencyType";
    
    
    [SdkBiClient OnVirtualCurrencyGain:info];
}

- (void)OnVirtualCurrencyGainForPurchasedBtnDidClick {
    
    NSLog(@"%s",__func__);
    VirtualCurrencyGainInfo *info = [VirtualCurrencyGainInfo new];
    info.gainChannel = @"gainChannel";
    info.gainChannelType = @"gainChannelType";
    info.amount = 1;
    info.virtualCurrencyTotal = 1;
    info.virtualCurrencyType = @"virtualCurrencyType";
    info.ext = @{@"info_ext_key":@"info_ext_value"};;
    [SdkBiClient OnVirtualCurrencyGainForPurchased:info tradeNo:@"tradeNo"];
}

- (void)OnVirtualCurrencyConsumeBtnDidClick {
    
    NSLog(@"%s",__func__);
    VirtualCurrencyGainInfo *info = [VirtualCurrencyGainInfo new];
    info.gainChannel = @"gainChannel";
    info.gainChannelType = @"gainChannelType";
    info.amount = 1;
    info.virtualCurrencyTotal = 1;
    info.virtualCurrencyType = @"virtualCurrencyType";
    info.ext = @{@"info_ext_key":@"info_ext_value"};;
    [SdkBiClient OnVirtualCurrencyConsume:info];
}

- (void)OnItemGainBtnDidClick {
    
    NSLog(@"%s",__func__);
    ItemGainInfo *info = [ItemGainInfo new];
    info.gainChannel = @"gainChannel";
    info.gainChannelType = @"gainChannelType";
    info.amount = 1;
    info.itemTotal = 1;
    info.itemName = @"itemName";
    info.itemType = @"itemType";
    
    info.ext = @{@"info_ext_key":@"info_ext_value"};;
    [SdkBiClient OnItemGain:info];
}

- (void)OnItemConsumeBtnDidClick {
    
    NSLog(@"%s",__func__);
    ItemGainInfo *info = [ItemGainInfo new];
    info.gainChannel = @"gainChannel";
    info.gainChannelType = @"gainChannelType";
    info.amount = 1;
    info.itemTotal = 1;
    info.itemName = @"itemName";
    info.itemType = @"itemType";
    
    info.ext = @{@"info_ext_key":@"info_ext_value"};;
    [SdkBiClient OnItemConsume:info];
}

- (void)OnGameLoadResourceDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnGameLoadResource];
}

- (void)OnGameLoadConfigBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnGameLoadConfig];
}

- (void)OnOpenAnnouncementBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnOpenAnnouncement];
}

- (void)OnCloseAnnouncementBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnCloseAnnouncement];
}


- (void)OnNewUserMissionBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnNewUserMission];
}

// -------------
- (void)OnScanResultSuccessBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnScanResultSuccess:@"OnScanResultSuccess" phoneInfo:@{@"phoneInfo_key":@"phoneInfo_value"}];
}

- (void)OnScanResultFailBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnScanResultFail:@"key" msg:@"msg" phoneInfo:@{@"phoneInfo_key":@"phoneInfo_value"}];
}

- (void)OnClickDownloadLinkBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnClickDownloadLink:@{@"phoneInfo_key":@"phoneInfo_value"}];
}

- (void)OnRegisterBtnDidClick {
    
    NSLog(@"%s",__func__);
    RoleInfo *roleInfo = [RoleInfo new];
    roleInfo.roleLevel = roleLevel;
    roleInfo.roleVipLevel = roleVipLevel;
    roleInfo.accountId = @"accountId";
    roleInfo.roleId = @"roleId";
    roleInfo.server = @"server";
    roleInfo.zoneId = @"zoneId";
    roleInfo.roleName = @"roleName";
    roleInfo.serverName = @"serverName";
    roleInfo.zoneName = @"zoneName";
    roleInfo.partyName = @"partyName";
    roleInfo.gender = @"f";
    roleInfo.ext = @{@"roleInfo_ext_key":@"roleInfo_ext_value"};

    [SdkBiClient OnRegister:roleInfo];
}

- (void)OnSelectProductBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnSelectProduct:@"OnSelectProduct"];
}

- (void)OnGameCreateOrderResultBtnDidClick {
    
    NSLog(@"%s",__func__);

    [SdkBiClient OnGameCreateOrderResult:@"OnGameCreateOrderResult" state:@"state" gameTradeNo:@"gameTradeNo" nOrderCreateCode:@"nOrderCreateCode" szOrderCreateMsg:@"szOrderCreateMsg"];
}

- (void)OnPrivateFunCodeUseBtnDidClick {
    
    NSLog(@"%s",__func__);
    FunCodeInfo *info = [FunCodeInfo new];
    info.code = @"code";
    info.codeDesc = @"codeDesc";
    info.codeType = @"codeType";
    info.batchId = @"batchId";
    
    info.ext = @{@"roleInfo_ext_key":@"roleInfo_ext_value"};
    [SdkBiClient OnPrivateFunCodeUse:info];
}

- (void)OnPublicFunCodeUseBtnDidClick {
    
    NSLog(@"%s",__func__);
    FunCodeInfo *info = [FunCodeInfo new];
    info.code = @"code";
    info.codeDesc = @"codeDesc";
    info.codeType = @"codeType";
    info.batchId = @"batchId";
    
    info.ext = @{@"roleInfo_ext_key":@"roleInfo_ext_value"};
    [SdkBiClient OnPublicFunCodeUse:info];
}

- (void)OnFunCodeUseBtnDidClick {
    
    NSLog(@"%s",__func__);
    FunCodeInfo *info = [FunCodeInfo new];
    info.code = @"code";
    info.codeDesc = @"codeDesc";
    info.codeType = @"codeType";
    info.batchId = @"batchId";
    
    info.ext = @{@"roleInfo_ext_key":@"roleInfo_ext_value"};
    [SdkBiClient OnFunCodeUse:info scope:@"scope"];
}


- (void)OnPayCancelBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    
    PayResult *payResult = [PayResult new];
    payResult.code = 1;
    payResult.msg = @"msg";
    payResult.gameTradeNo = @"gameTradeNo";
    payResult.xgTradeNo = @"xgTradeNo";
    payResult.channelCode = @"channelCode";
    payResult.channelMsg = @"channelMsg";
    payResult.ext =  @{@"payResult_ext_key":@"payResult_ext_value"};
    [SdkBiClient OnPayCancel:payInfo payResult:payResult];
}


- (void)OnPayFailBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    
    PayResult *payResult = [PayResult new];
    payResult.code = 1;
    payResult.msg = @"msg";
    payResult.gameTradeNo = @"gameTradeNo";
    payResult.xgTradeNo = @"xgTradeNo";
    payResult.channelCode = @"channelCode";
    payResult.channelMsg = @"channelMsg";
    payResult.ext =  @{@"payResult_ext_key":@"payResult_ext_value"};
    
    [SdkBiClient OnPayCancel:payInfo payResult:payResult];
}


- (void)OnPayOtherBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    
    PayResult *payResult = [PayResult new];
    payResult.code = 1;
    payResult.msg = @"msg";
    payResult.gameTradeNo = @"gameTradeNo";
    payResult.xgTradeNo = @"xgTradeNo";
    payResult.channelCode = @"channelCode";
    payResult.channelMsg = @"channelMsg";
    payResult.ext =  @{@"payResult_ext_key":@"payResult_ext_value"};
    
    [SdkBiClient OnPayOthers:payInfo payResult:payResult];
}


- (void)OnPaySuccessBtnDidClick {
    
    NSLog(@"%s",__func__);
    PayInfo *payInfo = [PayInfo new];
    payInfo.uid = @"uid";
    payInfo.productId = @"productId";
    payInfo.productName = @"productName";
    payInfo.productDesc = @"productDesc";
    payInfo.productUnit = @"productUnit";
    payInfo.productUnitPrice = 2;
    payInfo.productQuantity = 3;
    payInfo.totalAmount = 4;
    payInfo.payAmount = 5;
    payInfo.currencyName = @"currencyName";
    payInfo.virtualCurrencyBalance = @"virtualCurrencyBalance";
    payInfo.customInfo = @"customInfo";
    payInfo.gameTradeNo = @"gameTradeNo";
    payInfo.gameCallbackUrl = @"gameCallbackUrl";
    payInfo.additionalParams = @"additionalParams";
    payInfo.ext = @{@"payInfo_ext_key":@"payInfo_ext_value"};
    
    PayResult *payResult = [PayResult new];
    payResult.code = 1;
    payResult.msg = @"msg";
    payResult.gameTradeNo = @"gameTradeNo";
    payResult.xgTradeNo = @"xgTradeNo";
    payResult.channelCode = @"channelCode";
    payResult.channelMsg = @"channelMsg";
    payResult.ext =  @{@"payResult_ext_key":@"payResult_ext_value"};
    
    [SdkBiClient OnPaySuccess:payInfo payResult:payResult];
}

- (void)OnScanStartBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnScanStart];
}

- (void)OnAccountRegisterBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnAccountRegister:@"OnAccountRegister" ext:@{@"OnAccountRegister_key":@"OnAccountRegister_value"}];
}

- (void)OnLoginBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnLogin];
}

- (void)OnPayBtnDidClick {
    
    NSLog(@"%s",__func__);
    [SdkBiClient OnPay];
}

- (void)OnXgStartBtnClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnInitStart];
}

- (void)OnPushMessageBtnDidClick {
    NSLog(@"%s",__func__);
    PushInfo*info = [PushInfo new];
    info.msgId = @"msgId";
    info.process = @"process";
    info.afterOpen = @"afterOpen";
    info.deviceToken = @"deviceToken";
    info.alias = @"alias";
    info.aliasType = @"aliasType";
    [SdkBiClient OnPushMessage:info];
}

- (void)OnInitFailBtnDidClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnInitFail:0 msg:@"msg" channelCode:@"channelCode"];
}

- (void)OnInitSuccessBtnDidClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnLoginSuccess:0 authInfo:@"authInfo"];
}

- (void)OnLoginFailBtnDidClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnLoginFail:-100 msg:@"OnLoginFail" channelCode:@"channelCode"];
}

- (void)OnLoginCancelDidClick {
    NSLog(@"%s",__func__);
    [SdkBiClient OnLoginCancel:-100 msg:@"OnLoginCancel" ];
}

- (void)getDeviceIdDidClick {
    NSLog(@"%s",__func__);
    NSString * deviceid = [SdkBiClient GetDeviceId];
    NSLog(@"deviceID : %@",deviceid);
}

- (void)setRepresentedObject:(id)representedObject {
    [super setRepresentedObject:representedObject];

    // Update the view, if already loaded.
}


@end
